/* GUI CONVERTED from rppqrp.p (converter v1.75) Sat Aug 12 23:11:39 2000 */
/* rppqrp.p - PRODUCT LINE RESOURCE REQUIREMENT REPORT                  */
/* Copyright 1986-2002 QAD Inc., Carpinteria, CA, USA.                  */
/* All rights reserved worldwide.  This is an unpublished work.         */
/* web convert rppqrp.p (converter v1.00) Fri Oct 10 13:57:19 1997 */
/* web tag in rppqrp.p (converter v1.00) Mon Oct 06 14:17:45 1997 */
/*F0PN*/ /*K1DF*/ /*                                                    */
/*V8:ConvertMode=FullGUIReport                                 */
/* REVISION: 1.0     LAST MODIFIED: 04/30/86    BY: EMB */
/* REVISION: 4.0     LAST MODIFIED: 02/24/88    BY: WUG *A175**/
/* REVISION: 5.0     LAST MODIFIED: 09/26/90    BY: RAM *B793**/
/* REVISION: 6.0     LAST MODIFIED: 10/24/90    BY: emb *D137**/
/* REVISION: 8.6     LAST MODIFIED: 12/11/97    BY: bvm *K1DF**/
/* REVISION: 9.1      LAST MODIFIED: 03/24/00 BY: *N08T* Annasaheb Rahane */
/* REVISION: 9.1      LAST MODIFIED: 08/12/00 BY: *N0KP* myb              */

/*K1DF*/ /* DISPLAY TITLE */

/*GUI global preprocessor directive settings */
&GLOBAL-DEFINE PP_PGM_RP TRUE
&GLOBAL-DEFINE PP_ENV_GUI TRUE


/*GUI preprocessor directive settings */
&SCOPED-DEFINE PP_GUI_CONVERT_MODE REPORT

/*K1DF*/ {mfdtitle.i "b+ "}

define variable prod_line like pq_prod_line.
define variable prod_line1 like pq_prod_line.
define variable site like pq_site.
define variable site1 like pq_site.
define variable rsc like pq_rsc.
define variable rsc1 like pq_rsc.
define variable start like pq_start.
define variable pqend like pq_end.
define variable desc1 like pl_desc.
define variable rsdesc like rs_desc.
define variable um like rs_um.

/*K1DF* /* DISPLAY TITLE */
 * {mfdtitle.i "b+ "} */

site = global_site.
site1 = global_site.


/*GUI preprocessor Frame A define */
&SCOPED-DEFINE PP_FRAME_NAME A

FORM /*GUI*/ 
   
 RECT-FRAME       AT ROW 1.4 COLUMN 1.25
 RECT-FRAME-LABEL AT ROW 1   COLUMN 3 NO-LABEL
 SKIP(.1)  /*GUI*/
prod_line      colon 15
   prod_line1     label {t001.i} colon 49 skip
   site           colon 15
   site1          label {t001.i} colon 49 skip
   rsc            colon 15
   rsc1           label {t001.i} colon 49 skip
   start          colon 15
   pqend          label {t001.i} colon 49 skip
 SKIP(.4)  /*GUI*/
with frame a side-labels
/*K1DF*/ width 80 NO-BOX THREE-D /*GUI*/.

 DEFINE VARIABLE F-a-title AS CHARACTER.
 F-a-title = &IF (DEFINED(SELECTION_CRITERIA) = 0)
  &THEN " Selection Criteria "
  &ELSE {&SELECTION_CRITERIA}
  &ENDIF .
 RECT-FRAME-LABEL:SCREEN-VALUE in frame a = F-a-title.
 RECT-FRAME-LABEL:WIDTH-PIXELS in frame a =
  FONT-TABLE:GET-TEXT-WIDTH-PIXELS(
  RECT-FRAME-LABEL:SCREEN-VALUE in frame a + " ", RECT-FRAME-LABEL:FONT).
 RECT-FRAME:HEIGHT-PIXELS in frame a =
  FRAME a:HEIGHT-PIXELS - RECT-FRAME:Y in frame a - 2.
 RECT-FRAME:WIDTH-CHARS IN FRAME a = FRAME a:WIDTH-CHARS - .5. /*GUI*/

/*GUI preprocessor Frame A undefine */
&UNDEFINE PP_FRAME_NAME



/* SET EXTERNAL LABELS */
setFrameLabels(frame a:handle).

/*K1DF*/ {wbrp01.i}


/*GUI*/ {mfguirpa.i true  "printer" 132 }

/*GUI repeat : */
/*GUI*/ procedure p-enable-ui:


   if prod_line1 = hi_char then prod_line1 = "".
   if site1 = hi_char then site1 = "".
   if rsc1 = hi_char then rsc1 = "".

/*K1DF*/ if c-application-mode <> 'web' then
   
run p-action-fields (input "display").
run p-action-fields (input "enable").
end procedure. /* p-enable-ui, replacement of Data-Entry GUI*/

/*GUI*/ procedure p-report-quote:


/*K1DF*/ {wbrp06.i &command = update &fields = "  prod_line prod_line1 site
          site1 rsc rsc1 start pqend" &frm = "a"}

/*K1DF*/ if (c-application-mode <> 'web') or
/*K1DF*/ (c-application-mode = 'web' and
/*K1DF*/ (c-web-request begins 'data')) then do:

   bcdparm = "".
   {mfquoter.i prod_line}
   {mfquoter.i prod_line1}
   {mfquoter.i site   }
   {mfquoter.i site1  }
   {mfquoter.i rsc    }
   {mfquoter.i rsc1   }
   {mfquoter.i start  }
   {mfquoter.i pqend  }

/*K1DF*/ end.

   /* SELECT PRINTER */
   
/*GUI*/ end procedure. /* p-report-quote */
/*GUI - Field Trigger Section */

/*GUI MFSELxxx removed*/
/*GUI*/ procedure p-report:
/*GUI*/   {gpprtrpa.i  "printer" 132}
/*GUI*/   mainloop: do on error undo, return error on endkey undo, return error:



   {mfphead.i}

   if prod_line1 = "" then prod_line1 = hi_char.
   if site1 = "" then site1 = hi_char.
   if rsc1 = "" then rsc1 = hi_char.

   for each pq_mstr use-index pq_mstr where
   (pq_prod_line >= prod_line and pq_prod_line <= prod_line1)
   and (pq_site >= site and pq_site <= site1)
   and (pq_rsc >= rsc and pq_rsc <= rsc1)
/*B793*    and (pq_start >= start or start = ?) */
/*B793*    and (pq_end <= pqend or pqend = ?) */
/*B793*/   and (pq_start <= pqend or pq_start = ? or pqend = ?)
/*B793*/   and (pq_end >= start or pq_end = ? or start = ?)
   no-lock break by pq_prod_line with frame b:

      FORM /*GUI*/ 
     pq_prod_line
     desc1
     pq_site
     pq_rsc
     rsdesc
     pq_qty
     um
     pq_lead
     pq_lt_off
     pq_start
     pq_end
      with STREAM-IO /*GUI*/  frame b width 132.

      /* SET EXTERNAL LABELS */
      setFrameLabels(frame b:handle).

      desc1 = "".
      find pl_mstr where pl_prod_line = pq_prod_line no-lock no-error.
      if available pl_mstr then desc1 = pl_desc.

      rsdesc = "".
      um = "".
      find rs_mstr where rs_rsc = pq_rsc and rs_site = pq_site
      no-lock no-error.
      if available rs_mstr then do:
     rsdesc = rs_desc.
     um = rs_um.
      end.

      if first-of (pq_prod_line) then
      display pq_prod_line desc1 pq_site pq_rsc rsdesc pq_qty um
      pq_lead pq_lt_off pq_start pq_end with frame b STREAM-IO /*GUI*/ .
      else
      display pq_site pq_rsc rsdesc pq_qty um pq_lead pq_lt_off
      pq_start pq_end with frame b STREAM-IO /*GUI*/ .

      if last-of(pq_prod_line) then put skip(1).

      
/*GUI*/ {mfguirex.i } /*Replace mfrpexit*/

   end.

   /* REPORT TRAILER */
   
/*GUI*/ {mfguitrl.i} /*Replace mfrtrail*/

/*GUI*/ {mfgrptrm.i} /*Report-to-Window*/

end.

/*K1DF*/ {wbrp04.i &frame-spec = a}

/*GUI*/ end procedure. /*p-report*/
/*GUI*/ {mfguirpb.i &flds=" prod_line prod_line1 site site1 rsc rsc1 start pqend "} /*Drive the Report*/
